<include file="Public:header" />
<div class="row wrapper border-bottom white-bg page-heading">
	<div class="col-lg-10">
		<h2>操作日志</h2>
		<ol class="breadcrumb">
			<li>
				<a href="{:U('dynamic/index')}">首页</a>
			</li>
			<li>
				<a>系统设置</a>
			</li>
			<li class="active">
				<strong>操作日志</strong>
			</li>
		</ol>
	</div>
	<div class="col-lg-2">

	</div>
</div>
<div class="wrapper wrapper-content ">
	<div class="row">
		<include file="Public:alert" />
		<div class="ibox float-e-margins">
			<div class="col-lg-2">
				<div class="ibox-title">
					<p style="font-size:15px;margin-bottom:0px;">
						<strong>{:L('VIEW_BY_LOG_CATEGORY')}</strong>
					</p>
				</div>
				<div class="ibox-content">
					<ul class="nav nav-pills nav-stacked" role="tablist">
						<li <if condition="$_GET['module'] eq null">class="active"</if>>
							<a href="{:U('action_log/index','by='.$_GET['by'])}" ><i class="fa fa-white fa fa-chevron-right"></i>{:L('ALL')}</a>
						</li>
						<li <if condition="$_GET['module'] eq 'business'">class="active"</if>>
							<a href="{:U('action_log/index','module=business&by='.$_GET['by'].'&act='.$_GET['act'])}" ><i class="fa fa-chevron-right"></i>{:L('BUSINESS')}</a>
						</li>
						<li <if condition="$_GET['module'] eq 'product'">class="active"</if>>
							<a href="{:U('action_log/index','module=product&by='.$_GET['by'].'&act='.$_GET['act'])}" ><i class="fa fa-chevron-right"></i>{:L('PRODUCT')}</a>
						</li>
						<li <if condition="$_GET['module'] eq 'customer'">class="active"</if>>
							<a href="{:U('action_log/index','module=customer&by='.$_GET['by'].'&act='.$_GET['act'])}" ><i class="fa fa-chevron-right"></i>{:L('CUSTOMER')}</a>
						</li>
						<li <if condition="$_GET['module'] eq 'leads'">class="active"</if>>
							<a href="{:U('action_log/index','module=leads&by='.$_GET['by'].'&act='.$_GET['act'])}" ><i class="fa fa-chevron-right"></i>{:L('LEADS')}</a>
						</li>
						<li <if condition="$_GET['module'] eq 'finance'">class="active"</if>>
							<a href="{:U('action_log/index','module=finance&by='.$_GET['by'].'&act='.$_GET['act'])}" ><i class="fa fa-chevron-right"></i>{:L('FINANCE')}</a>
						</li>
						<li <if condition="$_GET['module'] eq 'purchase'">class="active"</if>>
							<a href="{:U('action_log/index','module=purchase&by='.$_GET['by'].'&act='.$_GET['act'])}" ><i class="fa fa-chevron-right"></i>{:L('PURCHASE')}</a>
						</li>
						<li <if condition="$_GET['module'] eq 'sales'">class="active"</if>>
							<a href="{:U('action_log/index','module=sales&by='.$_GET['by'].'&act='.$_GET['act'])}" ><i class="fa fa-chevron-right"></i>{:L('SALES')}</a>
						</li>
					</ul>
				</div>
			</div>
			<div class="col-lg-10 ">
				<div class="ibox-title">
					<div class="" style="font-size:15px">
						<b>{:L('VIEW_NAV')}</b>
						<img src=" __PUBLIC__/img/by_owner.png"/> <a href="{:U('action_log/index')}" <if condition="$Think.get.by eq null">class="active"</if>>{:L('ALL')}</a> |
						<a href="{:U('action_log/index','by=me')}" <if condition="$Think.get.by eq 'me'">class="active"</if>>{:L('MY_LOG')}</a> |
						<img src="__PUBLIC__/img/by_time.png"/> <a href="{:U('action_log/index','by=today')}" <if condition="$Think.get.by eq 'today'">class="active"</if>>{:L('CREATE_TODAY')}</a> | 
						<a href="{:U('action_log/index','by=week')}" <if condition="$Think.get.by eq 'week'">class="active"</if>>{:L('CREATE_THIS_WEEK')}</a> | 
						<a href="{:U('action_log/index','by=month')}" <if condition="$Think.get.by eq 'month'">class="active"</if>>{:L('CREATE_THIS_MONTH')}</a>  &nbsp; 
						<a href="{:U('action_log/index','by=add')}" <if condition="$Think.get.by eq 'add'">class="active"</if>>{:L('RECENTLY_CREATED')}</a>
					</div>
				</div>
				<div class="ibox-content clearfix"  style="padding-bottom:10px">
					<ul class="nav pull-left">		
						<li class="pull-left"><button id="delete" class="btn btn-primary btn-sm" ><i class="fa fa-remove"></i>&nbsp;{:L('DELETE')}</button> </li>
						<li class="pull-left">
							<form class="form-inline" id="searchForm" onsubmit="return checkSearchForm();" action="index.php" method="get">
								<ul class="nav pull-left">
									<li class="pull-left">
										&nbsp;
										<select id="field" class="form-control input-sm" style="width:auto" onchange="changeCondition()" name="field">
											<option class="word" value="content">{:L('OPERATOR')}</option>
											<option class="date" value="create_time">{:L('OPERATING_TIME')}</option>
										</select>&nbsp;&nbsp;
									</li>
									<li id="conditionContent" class="pull-left">
									<select id="condition" class="form-control input-sm" style="width:auto" name="condition" onchange="changeSearch()">
										<option value="contains">{:L('CONTAINS')}</option>
										<option value="not_contain">{:L('NOT_CONTAIN')}</option>
										<option value="is">{:L('IS')}</option>
										<option value="isnot">{:L('ISNOT')}</option>						
										<option value="start_with">{:L('START_WITH')}</option>
										<option value="end_with">{:L('END_WITH')}</option>
										<option value="is_empty">{:L('IS_EMPTY')}</option>
										<option value="is_not_empty">{:L('IS_NOT_EMPTY')}</option>
										</select>&nbsp;&nbsp;
									</li>
									<li id="searchContent" class="pull-left"><input id="search" type="text" class="form-control input-sm search-query" name="search"/>&nbsp;&nbsp;</li>
									<li class="pull-left"><input type="hidden" name="m" value="action_log"/>
									<if condition="$Think.get.by neq null"><input type="hidden" name="by" value="{$Think.get.by}"/></if>
									<if condition="$Think.get.act neq null"><input type="hidden" name="act" value="{$Think.get.act}"/></if>
									<if condition="$Think.get.module neq null"><input type="hidden" name="module" value="{$Think.get.module}"/></if>
									<button type="submit" class="btn btn-primary btn-sm"> <img src="__PUBLIC__/img/search.png"/>  {:L('SEARCH')}</button></li>
								</ul>
							</form>
						</li>
					</ul>
					<form id="form1" method="post">
					<table class="table table-hover table-striped table_thead_fixed">
						<if condition="$list eq null">
							<tr><td>{:L('EMPTY_TPL_DATA')}</td></tr>
						<else/>
							<thead>
								<tr>
									<th><input id="check_all" class="check_all" type="checkbox" /></th>
									<th>{:L('OPERATOR')}</th>
									<th>{:L('MODULE')}</th>
									<th>{:L('CONTENT')}</th>
									<th>
										<if condition="$_GET['asc_order'] == 'create_time'">
											<a href="{:U('actionLog/index','desc_order=create_time&'.$parameter)}">
												{:L('TIME')}&nbsp;<img src="__PUBLIC__/img/arrow_up.png">
											</a>
										<elseif condition="$_GET['desc_order'] == 'create_time'"/>
											<a href="{:U('actionLog/index','asc_order=create_time&'.$parameter)}">
												{:L('TIME')}&nbsp;<img src="__PUBLIC__/img/arrow_down.png">
											</a>
										<else/>
											<a href="{:U('actionLog/index','desc_order=create_time&'.$parameter)}">{:L('TIME')}</a>
										</if>
									</th>
								</tr>
							</thead>
							<tbody>
								<volist name="list" id="vo">
								<tr>
									<td><input class="check_list" type="checkbox" name="log_id[]" value="{$vo.log_id}"/></td>
									<td><notempty name="vo.creator.user_name"><a class="role_info" rel="{$vo.creator.role_id}" href="javascript:void(0)">{$vo.creator.user_name}</a></notempty></td>
									<td>{:L($vo['module_name'])}</a></td>
									<td>{$vo.content}</a></td>
									<td>{$vo.create_time|date="Y-m-d H:i:s",###}</td>
								</tr>
								</volist>
							</tbody>
							<tfoot>
								<tr>
									<td colspan="8">{$page}</td>
								</tr>
							</tfoot>
						</if>
					</table>
					
					</form>
				</div>
			</div>
		</div>
	</div>
</div>

<div class="" style="display:none;" id="dialog-role-info" title="{:L('DIALOG_USER_INFO')}">loading...</div>
<script type="text/javascript">
$("#dialog-role-info").dialog({
    autoOpen: false,
    modal: true,
	width: 600,
	maxHeight: 550,
	position: ["center",100]
});
$(function(){
	<if condition="$Think.get.field neq null">
		$("#field option[value='{$Think.get.field}']").prop("selected", true);changeCondition();
		$("#condition option[value='{$Think.get.condition}']").prop("selected", true);changeSearch();
		$("#search").prop('value', '{$Think.get.search}');
	</if>
	$('#delete').click(function(){
		if(confirm('{:L('CONFIRM_DELETE')}')){
			$("#form1").attr('action', '{:U("Action_log/delete")}');
			$("#form1").submit();
		}
	});
	$("#check_all").click(function(){
		$("input[class='check_list']").prop('checked', $(this).prop("checked"));
	});
	$(".role_info").click(function(){
		$role_id = $(this).attr('rel');
		$('#dialog-role-info').dialog('open');
		$('#dialog-role-info').load('{:U("user/dialoginfo","id=")}'+$role_id);
	});
})
</script>
<include file="Public:footer" />
